package Controllers

//  日志写入
import (
	"fmt"
	_ "fmt"
	"github.com/gin-gonic/gin"
	"net/http"
	_ "net/http"
	"yz-go/Common"
	_ "yz-go/Common"
	"yz-go/Logic"
)

// json
type RequestData struct {
	LicenseCode string `json:"licenseCode"`
}

func SZCourseList(c *gin.Context) {
	requestData := RequestData{
		LicenseCode: "LC_baeVZwUuwqa6KxN270Gbh0djsfH2w",
	}

	header := map[string]string{"Content-Type": "application/x-www-form-urlencoded"}

	url := "http://api.shark.shenzaokeji.com/third-party/third-party/getByLicenseCode"

	res := Common.SendPostRequest(url, header, requestData)

	fmt.Printf("返回：%#v", res)
	fmt.Println("=====2======")

	c.JSON(http.StatusOK, gin.H{
		"code": Common.ERROR,
		"msg":  "error",
		"data": res,
	})
}

func RefreshBindCourseValidate(c *gin.Context) {
	Logic.BindCourseValidate()
}

//
//curl -X POST \
//-H "Content-Type: application/json" \
//-d "licenseCode=LC_baeVZwUuwqa6KxN270Gbh0djsfH2w" \
//http://api.shark.shenzaokeji.com/third-party/third-party/getByLicenseCode

//curl -X POST -d "name=John&email=john@example.com" http://example.com/form
